package com.karashi.busloca;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.UnsupportedEncodingException;

import org.apache.http.HttpResponse;

@Deprecated
public class BusLocaHttpResponse {

	private int httpStatusCode = 0;

	private String content = "";

	public BusLocaHttpResponse(HttpResponse response) throws UnsupportedEncodingException, IllegalStateException,
			IOException {
		httpStatusCode = response.getStatusLine().getStatusCode();

		BufferedReader reader = new BufferedReader(
				new InputStreamReader(response.getEntity().getContent(), "Shift_JIS"));

		StringBuilder builder = new StringBuilder();
		String line = null;
		while ((line = reader.readLine()) != null) {
			builder.append(line + "\n");
		}
		content = builder.toString();
	}

	public int getHttpStatusCode() {
		return httpStatusCode;
	}

	public void setHttpStatusCode(int httpStatusCode) {
		this.httpStatusCode = httpStatusCode;
	}

	public String getContent() {
		return content;
	}

	public void setContent(String content) {
		this.content = content;
	}

}
